package com.corner.model.cornerservice.domain;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.Expose;

public class Location extends BaseBean implements Parcelable {

    public static final String GEO_POINT = "geoPoint";
    public static final String LOCATION = "location";
    public static final String LOCATION_NAME = "locationName";
    public static final String ADDRESS = "address";
    public static final String PROVINCE = "province";
    public static final String CITY = "city";


    public User user;
    public Integer contentNum;
    @Expose
    private String locationName;
    @Expose
    private GeoPoint geoPoint;
    @Expose
    private String address;
    @Expose
    private String province;
    @Expose
    private String city;

    /***********************
     * 扩展
     ***********************/
    public boolean hasRequestUser;
    public boolean hasRequestContentNum;


    public Location() {
    }


    public static final Creator<Location> CREATOR = new Creator<Location>() {
        public Location createFromParcel(Parcel source) {
            return new Location(source);
        }

        public Location[] newArray(int size) {
            return new Location[size];
        }
    };
    protected Location(Parcel in) {
        super(in);
        this.locationName = in.readString();
        this.geoPoint = in.readParcelable(GeoPoint.class.getClassLoader());
        this.address = in.readString();
        this.province = in.readString();
        this.city = in.readString();
        this.user = in.readParcelable(User.class.getClassLoader());
        this.contentNum = (Integer) in.readValue(Integer.class.getClassLoader());
    }

    public String getLocationName() {
        return locationName;
    }

    public void setLocationName(String locationName) {
        this.locationName = locationName;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public GeoPoint getGeoPoint() {
        return geoPoint;
    }

    public void setGeoPoint(GeoPoint geoPoint) {
        this.geoPoint = geoPoint;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        super.writeToParcel(dest, flags);
        dest.writeString(this.locationName);
        dest.writeParcelable(this.geoPoint, 0);
        dest.writeString(this.address);
        dest.writeString(this.province);
        dest.writeString(this.city);
        dest.writeParcelable(this.user, 0);
        dest.writeValue(this.contentNum);
    }
}
